package com.cqyc.network.http

import com.cqyc.network.getid.GetMyInformationBox


class NConfig {
    companion object {
        private var webName = ""
        private var Web_View_Url = ""
        private var Web_View_Tile = ""
        private var Web_View_Title_Visible = ""

        fun initWebLink(
            webName: String,
            webViewUrl: String,
            webViewTile: String,
            webViewTitleVisible: String
        ) {
            this.webName = webName
            this.Web_View_Url = webViewUrl
            this.Web_View_Tile = webViewTile
            this.Web_View_Title_Visible = webViewTitleVisible
        }

        fun getWebName():String{
            return webName
        }

        fun getWebViewUrl():String{
            return Web_View_Url
        }

        fun getWebViewTile():String{
            return Web_View_Tile
        }

        fun getWebViewTitleVisible():String{
            return Web_View_Title_Visible
        }

        //自己的
        fun getSpContent(): String {
            return GetMyInformationBox.getSource()
        }

        //对方的
        fun getOtherSpContent(): String {
            return "merchant"
        }

        fun getRealId(str: String): String {
            return if (str.startsWith("merchant")) {
                str.substring("merchant".length)
            } else if (str.startsWith("ant")) {
                str.substring("ant".length)
            } else if (str.startsWith("union")) {
                str.substring("union".length)
            }else {
                str
            }
        }
    }
}